package thread;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread t=new Thread("李洋"){
            public void run(){
                System.out.println(getName()+":睡会儿");
                try {
                    Thread.sleep(10000000);
                } catch (InterruptedException e) {
                    System.out.println(getName()+":干嘛呢!");
                }
                System.out.println(getName()+":睡醒了");
            }
        };
        Thread t2=new Thread("刘界"){
            public void run(){
                System.out.println(getName()+":把它整醒");
                t.interrupt();
            }
        };
        t.start();
        t2.start();
    }
}
